package com.HospitalOutpatient.dao;

import com.HospitalOutpatient.entity.Department;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface DepartmentDao {

    @Select("select * from department")
    List<Department> selectAllDepartment();
    @Insert("insert into department values (null,#{departmentName})")
    int insertDepartment(Department department);
    @Update("update department set departmentName = #{departmentName} where departmentId = #{departmentId}")
    int updateDepartment(Department department);
    @Select("select * from department where departmentId = #{departmentId}")
    Department getDepartmentById(String departmentId);
}
